
<div class="tab-pane " id="grid_lottery">
    {if $system['is_shop_plan']==1} {/if}
    <div class="panel panel-default" role="tabpanel" style="">
        <div class="panel-heading">九宫格抽奖</div>
        <div class="panel-body" style="">

            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">活动规则：</label>
                <div class="col-sm-9 col-xs-12">
                    <table class='table'>
                        <thead>
                        <tr>
                            <th>规则序号</th>
                            <th>活动规则内容</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="yx_lt_rule_items">
                        {loop $config['yx_lt_rules'] $yx_lt_rule_item}
                        <tr >
                            <td><input name="yx_lt_rule_sort[]" type="text"
                                       class="form-control span3" value="{$yx_lt_rule_item['rule_sort']}"
                            /></td>

                            <td><input name="yx_lt_rule_content[]" type="text"
                                       class="form-control span3" value="{$yx_lt_rule_item['rule_content']}"
                            /></td>
                            <td>
                                <input  name="yx_lt_rule_id[]" type="hidden" value="{$yx_lt_rule_id['id']}" />
                                <a href='javascript:;' onclick='removeLtRuleItem(this)'><i
                                        class='glyphicon glyphicon-remove'></i> 删除</a></td>
                        </tr>
                        {/loop}
                        </tbody>
                    </table>
                    <a href="javascript:;" onclick="addLtRule();"><i class="glyphicon glyphicon-plus" title="添加规则"></i>添加规则</a>
                </div>
            </div>

        </div>
    </div>




   

<script>
    function addLtRule() {
        var html = "<tr>";
        html += '<td><input name="yx_lt_rule_sort[]" type="text" class="form-control span3" value="" /></td>';
        html += '<td><input name="yx_lt_rule_content[]" type="text" class="form-control span3" value="" /></td>';
        html += '<td> <input  name="yx_lt_rule_id[]" type="hidden" value="" />&nbsp;<a href="javascript:;" onclick="removeLtRuleItem(this)" ><i class="glyphicon glyphicon-remove"></i> 删除</a></td>';
        html += "</tr>";
        $("#yx_lt_rule_items").append(html);
    }
    function removeLtRuleItem(obj) {
        $(obj).parent().parent().remove();
    }
</script>